From: Marek Marczykowski Date: Wed, 8 May 2013 03:47:53 +0000 (+0200) Subject: libxl: do not call exit() in libxl_device_vtpm_list X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~6662 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22%22/%22http:/www.example.com/cgi/%22https:/%22%22?a=commitdiff_plain;h=af5102b81fd036976e785aa29dece8c3d2dd6577;p=xen.git libxl: do not call exit() in libxl_device_vtpm_list Signal error with NULL return value, do not terminate the whole process. Signed-off-by: Marek Marczykowski Reviewed-by: Jim Fehlig Acked-by: Ian Campbell --- diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index 3236aa96a0..bd63a305d7 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -1861,11 +1861,12 @@ libxl_device_vtpm *libxl_device_vtpm_list(libxl_ctx *ctx, uint32_t domid, int *n vtpm->backend_domid = atoi(tmp); tmp = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/uuid", be_path)); - if(tmp) { - if(libxl_uuid_from_string(&(vtpm->uuid), tmp)) { - LOG(ERROR, "%s/uuid is a malformed uuid?? (%s) Probably a bug!!\n", be_path, tmp); - exit(1); - } + if (tmp) { + if(libxl_uuid_from_string(&(vtpm->uuid), tmp)) { + LOG(ERROR, "%s/uuid is a malformed uuid?? (%s) Probably a bug!!\n", be_path, tmp); + free(vtpms); + return NULL; + } } } }